package com.njupt.item.pojo;

import com.njupt.pojo.TbItem;

/**
 * @Author: XJL
 * @Description:向商品详情页面返回对象
 * @Date: Create in 15:30 2018/5/31
 * @Modified By:
 **/
public class Item extends TbItem {

    private static final long serialVersionUID = 2914975662348725875L;

    public Item(TbItem tbItem){
        this.setId(tbItem.getId());
        this.setBarcode(tbItem.getBarcode());
        this.setCid(tbItem.getCid());
        this.setCreated(tbItem.getCreated());

        this.setImage(tbItem.getImage());
        this.setNum(tbItem.getNum());
        this.setPrice(tbItem.getPrice());
        this.setSellPoint(tbItem.getSellPoint());
        this.setStatus(tbItem.getStatus());
        this.setTitle(tbItem.getTitle());
        this.setUpdated(tbItem.getUpdated());

    }

    public String[] getImages(){
        if (this.getImage()!=null&&!"".equals(this.getImage())){
            String image2 = this.getImage();
            String[] images = image2.split(",");
            return images;
        }
        return null;
    }

    public Item() {
    }
}
